package reflection.cglibV2;

import net.sf.cglib.proxy.CallbackFilter;
import org.apache.commons.lang3.StringUtils;

import java.lang.reflect.Method;

/**
 * @author ChangLiang
 * @date 2020/3/18
 */
public class BookDaoProxyFilter implements CallbackFilter {


    @Override
    public int accept(Method method) {
        if (StringUtils.equals(method.getName(), "addBook")) {
            // array[0]
            return 0;
        }
        // array[1]
        return 1;
    }
}
